uses gpriorityqueue, gutil;

type lesslli = specialize less<longint>;
     pqlli = specialize priorityqueue<longint, lesslli>;

var data:pqlli; n,i:longint;

begin
  randomize;
  data:=pqlli.Create;
  read(n);
  for i:=1 to n do
    data.push(random(1000000000));
  for i:=1 to n do begin
    writeln(data.top);
    data.pop
  end;
end.
